package com.itheima.mapper;

import com.itheima.pojo.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 王同学
 */
@Mapper
@Repository
public interface EmployeeMapper {

    Employee SelectByUsernameandPassword(@Param("username") String username, @Param("password") String password);
    Employee SelectByIdNumber(@Param("IdNumber") String IdNumber);

    //映射 括号里面要和xml里面的参数名一样
    void updateToken(@Param("token") String token, @Param("id") String id);


    Employee getbyToken(String tokne);


    void clearToken(String id);
        //根据id把token给删了

    //查询员工id
    Employee getById(@Param("id") String id);
    //分页查询
    List<Employee> page(@Param("name") String name,@Param("start") Integer start,@Param("pageSize") Integer pageSize);

    //查询总共的数据有几条 ,如果只传一条数据可以不用写@Param 但是保险起见，给他写上
    long countEployee(@Param("name") String name);
    //新增员工
    boolean add(Employee employee);

    void update(Employee employee);


}
